def str_reverse(s):
    """
    将传入的字符串反转
    :param s: 需要进行反转的字符串
    :return: 反转后的字符串
    """
    try:
        return s[::-1]
    except Exception as e:
        print(e)
        print(f"参数{s}非字符串类型，无法处理")

def substr(s, x, y):
    """
    字符串的截取，从x截取到y
    :param s: 待截取的字符串入参
    :param x: 从x处开始截取
    :param y: 到y处结束
    :return: 截取后的字符串
    """
    # 注：当步长为1时，可以省略[:1]不写
    return s[x:y]

if __name__ == "__main__":
    print(str_reverse("good"))
    str1 = "goodgood"
    print(substr(str1, 2, len(str1)-5))